# coding = utf-8

from django.urls import path
from rest_framework.routers import DefaultRouter

from cards.api.views import CardViewSet, RetailerCardViewSet, CardImageUploadAPIView, CardImageDestroyAPIView, \
    CardListAPIView, CardDepositRecordViewSet, GiftCardViewSet, UserGiftCardViewSet, CardConsumeRecordViewSet, \
    RetailerCardListAPIView, SampleCardViewSet, ClientSampleRecordViewSet, BalanceBillViewSet
from cards.api.wechat_views import WxCardViewSet, WxRetailerCardViewSet, WxDiscountCardVerifyAPIView, WxCardGiftAPIView, \
    WxUserGiftCardViewSet, WxCardConsumeAPIView, WxCardConsumeRecordViewSet, WxGiftCardViewSet, BalanceAccountsStats, \
    MyBalanceAccountsStats, WxSampleCardViewSet, SampleCardRetriveAPIView, WxClientSampleRecordViewSet, \
    WxClientSampleConfirmAPIView, BalanceBillAPIView, BalanceBillListAPIView, BalanceBillStatsAPIView, \
    WxSampleCardAPIView

router = DefaultRouter()
router.register(r'card', CardViewSet, basename="card")
router.register(r'retailer_card', RetailerCardViewSet, basename="retailer-card")
router.register(r'card_deposit', CardDepositRecordViewSet, basename="card-deposit")
router.register(r'gift_card', GiftCardViewSet, basename="gift-card")
# router.register(r'user_gift_card', UserGiftCardViewSet, basename="user-gift-card")
# router.register(r'card_consume', CardConsumeRecordViewSet, basename="card-consume")
router.register(r'sample_card', SampleCardViewSet, basename="sample-card")
router.register(r'client_sample_record', ClientSampleRecordViewSet, basename="client-sample-record")
router.register(r'balance_bill', BalanceBillViewSet, basename="balance-bill")
# 微信
router.register(r'wx_card', WxCardViewSet, basename="wx-card")
router.register(r'wx_retailer_card', WxRetailerCardViewSet, basename="wx-retailer-card")
router.register(r'wx_gift_card', WxGiftCardViewSet, basename="wx-gift-card")
router.register(r'wx_user_card', WxUserGiftCardViewSet, basename="wx-user-gift-card")
router.register(r'wx_card_consume_list', WxCardConsumeRecordViewSet, basename="wx-user-card-consume-list")
router.register(r'wx_sample_card', WxSampleCardViewSet, basename="wx-sample-card")
router.register(r'wx_client_sample_record', WxClientSampleRecordViewSet, basename="wx-client-sample-record")
router.register(r'wx_client_sample_record', WxClientSampleRecordViewSet, basename="wx-client-sample-record")


urlpatterns = [
    path('image_upload/', CardImageUploadAPIView.as_view(), name="api-card-image-upload"),
    path('image_del/<int:card_id>/', CardImageDestroyAPIView.as_view(), name="api-card-image-del"),
    path('card_list/', CardListAPIView.as_view(), name="api-card-list"),
    path('retailer_card_list/', RetailerCardListAPIView.as_view(), name="api-retailer-card-list"),
    path('discount_card_verify/', WxDiscountCardVerifyAPIView.as_view(), name="api-discount-card-verify"),
    path('wx_card_gift/', WxCardGiftAPIView.as_view(), name="api-wx-card-gift"),
    path('wx_card_consume/', WxCardConsumeAPIView.as_view(), name="api-wx-card-consume"),
    path('wx_balance_account_stats/', BalanceAccountsStats.as_view(), name="api-balance-account-stats"),
    path('wx_my_balance_account_stats/', MyBalanceAccountsStats.as_view(), name="api-my-balance-account-stats"),
    path('wx_sample_card_detail/<str:key>/', SampleCardRetriveAPIView.as_view(), name="api-sample-card-single"),
    path('wx_csample_confirm/', WxClientSampleConfirmAPIView.as_view(), name="api-client-sample-confirm"),
    path('wx_balance_bill/', BalanceBillAPIView.as_view(), name="api-wx-balance-bill"),
    path('wx_balance_bill_his/', BalanceBillListAPIView.as_view(), name="api-wx-balance-bill-his"),
    path('wx_balance_bill_stats/', BalanceBillStatsAPIView.as_view(), name="api-wx-balance-bill-stats"),
    path('wx_sample_card_ex/', WxSampleCardAPIView.as_view(), name="api-wx-sample-card"),
]
urlpatterns += router.urls
